package xin.marcher.module.replenished.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Repository;
import xin.marcher.module.common.enums.DelFlagEnum;
import xin.marcher.module.replenished.domain.entity.ItemProcurementConfigDO;
import xin.marcher.module.replenished.mapper.AttributeExtendMapper;
import xin.marcher.module.replenished.mapper.ItemProcurementConfigMapper;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品 相关配置资源类
 *
 *
 */
@Repository
public class ProductConfigRepository {

    @Resource
    private AttributeExtendMapper attributeExtendMapper;

    @Resource
    private ItemProcurementConfigMapper itemProcurementConfigMapper;

    /**
     * 查询商品无需配置采购的集合信息
     *
     * @return
     */
    public List<ItemProcurementConfigDO> queryProcurementConfigList() {
        LambdaQueryWrapper<ItemProcurementConfigDO> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(ItemProcurementConfigDO::getDelFlag, DelFlagEnum.EFFECTIVE.getCode());
        return itemProcurementConfigMapper.selectList(queryWrapper);
    }
}
